//package com.zxy.ziems.server.monitor.job;
//
//import com.zxy.ziems.server.monitor.service.MonitorDeviceService;
//import lombok.extern.slf4j.Slf4j;
//import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.scheduling.annotation.Async;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
///**
// * 监控
// * @author chdzq
// * @create 2023/5/25
// */
//@Component
//@Slf4j
//public class MonitorJob implements ApplicationRunner {
//    /**
//     * 同步海康监控
//     */
////    @Scheduled(cron = "0 1 * * * ?")
//    @Scheduled(cron = "0 0 1 * * ?")
////    @SchedulerLock(name = "SyncMonitorDevice", lockAtMostFor = "500s", lockAtLeastFor = "40s")
//    public void synchronizeMonitorDevices() {
//        deviceService.synchronizeDevices();
//    }
//
//    @Scheduled(cron = "0 0 1 * * ?")
//    @SchedulerLock(name = "SubscriptionMonitorEvent", lockAtMostFor = "500s", lockAtLeastFor = "40s")
//    public void subscriptionEvent() {
//        deviceService.subscriptionEvent();
//    }
//
//    private MonitorDeviceService deviceService;
//
//    @Autowired
//    public void setDeviceService(MonitorDeviceService monitorDeviceService) {
//        this.deviceService = monitorDeviceService;
//    }
//
//    @Override
//    @Async
//    public void run(ApplicationArguments args) throws Exception {
//        try {
//            deviceService.subscriptionEvent();
//        } catch (Exception e) {
//            e.printStackTrace();
//            log.error("[海康]请求错误{}", e.getLocalizedMessage());
//        }
//    }
//}
